Skip to content

BUILD: Call the staging cloud from the cloud tests until production has the release - #299

Draft
jwrosewell wants to merge 1 commit into
rcfrom
ci/cloud-tests-on-staging
Draft

jwrosewell wants to merge 1 commit into
rcfrom
ci/cloud-tests-on-staging

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

The device detection cloud test test_available_properties reads its property list from the header of the day's data file, which now holds ServiceWorkers. The production cloud does not offer ServiceWorkers yet, so the test fails with Exception: Property: serviceworkers is not present in the results. (an example from today). The cloud release that adds the property reaches the staging cloud first, so the cloud integration tests call the staging cloud until production has that release.

What changes

  • ci/run-integration-tests.ps1, the integration test step that common-ci calls in the Build and Test jobs of its pull request and publish workflows, gives every cloud test the staging cloud when CLOUD_STAGING_ENDPOINT is set, as _51DEGREES_CLOUD_ENDPOINT. That covers the device detection, IP Intelligence, location and pipeline cloud tests, because they all read that name. It puts the name back afterwards, also when the step fails, because common-ci runs the later steps in the same process, and it says which cloud the tests call.
  • The tests keep _51DEGREES_RESOURCE_KEY_BESPOKE, which the staging cloud knows and which carries every product they ask for. RESOURCE_KEY_BESPOKE_STAGING carries no hardware product on the staging cloud, so with it the TAC and native model lookup example tests fail with The resource key in _51DEGREES_RESOURCE_KEY_BESPOKE does not include HardwarePlatform.Profiles, which the TAC lookup needs. It also lacks IsGdpr and the seven GeoNameId properties of the IP product (ContinentGeoNameId, CountryGeoNameId, CountyGeoNameId, RegisteredCountryGeoNameId, StateGeoNameId, StateGeoNameIdsGeographical and TownGeoNameId), which the Bespoke key carries.
  • ci/key-names.Tests.ps1 checks the switch with the name set and not set, that the endpoint is put back after the step, when it fails and when it was not set before, that the Bespoke key is left as it is, and that no other CI script reads CLOUD_STAGING_ENDPOINT and none reads RESOURCE_KEY_BESPOKE_STAGING. The existing checks that only the Cloud Human Confidence and Cloud 51Did workflows give the staging names are unchanged.
  • AGENTS.md and pipeline/ci/README.md say the same.

What is still missing before the tests call staging in CI

CLOUD_STAGING_ENDPOINT does not reach the Build and Test jobs today, so until it does this change only prints CLOUD_STAGING_ENDPOINT is not set, so the cloud tests call the cloud _51DEGREES_CLOUD_ENDPOINT names. and the tests run against production as they do now.

common-ci's main (b372b34) exports to those jobs only _51DEGREES_ names, its own CI secrets and the secrets a repository lists in its own ci/ci-secrets.psd1. CLOUD_STAGING_ENDPOINT is an organization variable, not a secret, and steps/export-secrets.ps1 stops the job when a listed name is not one of the job's secrets, so the variable cannot be listed either. This morning's rc build exported _51DEGREES_CLOUD_ENDPOINT and no other variable. common-ci needs a way for a repository to name an organization variable its scripts read, as ci/ci-secrets.psd1 names a secret.

Proof

In the CI script tests of this pull request, 519 tests passed on Ubuntu and on Windows, the five new ones among them, and the environment variable name check passed.

Each new test was also run against three broken versions of the script, and each version made at least two of the new tests fail. The three versions were the script as it is on rc, the script without the step that puts the endpoint back, and the script with the staging key given to the tests.

Local runs on 1 December 2026, with the header of that day's TAC CSV, which lists ServiceWorkers, as tests/51Degrees.csv, and the packages installed from this branch:

Tests Cloud Key Result
fiftyone_devicedetection_cloud/tests/test_properties.py production Bespoke test_available_properties fails, serviceworkers is not present in the results, as in CI
fiftyone_devicedetection_cloud/tests staging, before the release Bespoke 30 passed, 1 failed, being test_available_properties, the same way
fiftyone_devicedetection_examples/tests/test_cloudexamples.py staging Bespoke 6 passed
fiftyone_devicedetection_examples/tests/test_cloudexamples.py staging RESOURCE_KEY_BESPOKE_STAGING 4 passed, 2 failed, the TAC and native model lookups, for want of HardwarePlatform.Profiles
fiftyone_devicedetection_examples/tests -k cloud staging Bespoke 30 passed, and the modules that need the on-premise package were not collected
location/tests staging Bespoke, and the staging key 16 passed with each
fiftyone_pipeline_cloudrequestengine/tests staging Bespoke 202 passed
fiftyone_pipeline_cloudrequestengine/examples/tests staging Bespoke 129 passed, and the 4 tests marked staging skipped, as they do in the shared integration tests

The IP Intelligence example tests were not run locally, as they need the on-premise package built.

What is still to come is test_available_properties passing against the staging cloud once it has the release. At 15:08 UTC on 1 December 2026 the staging cloud still answered as 4.4.57-rc.6, and neither Bespoke key's device product listed ServiceWorkers.

How to undo

Revert the commit. Once the production cloud has the release, the same lines come out by hand: the staging block in ci/run-integration-tests.ps1, the The root run-integration-tests.ps1 block and the staging check under The CI scripts in ci/key-names.Tests.ps1, and the staging paragraphs in AGENTS.md and pipeline/ci/README.md.

No version changes.

…as the release

The device detection cloud test test_available_properties reads the property
list from the day's data file, which now holds ServiceWorkers. The production
cloud does not offer that property yet, so the test fails with "Property:
serviceworkers is not present in the results".

ci/run-integration-tests.ps1 now gives every cloud test the staging cloud
when CLOUD_STAGING_ENDPOINT is set, as _51DEGREES_CLOUD_ENDPOINT, and puts
that name back afterwards, also when the step fails, because common-ci runs
the later steps in the same process. It says which cloud the tests call.

The tests keep _51DEGREES_RESOURCE_KEY_BESPOKE, which the staging cloud
knows and which carries every product they ask for.
RESOURCE_KEY_BESPOKE_STAGING carries no hardware product on the staging
cloud, so with it the TAC and native model lookup example tests fail with
"The resource key in _51DEGREES_RESOURCE_KEY_BESPOKE does not include
HardwarePlatform.Profiles, which the TAC lookup needs."

ci/key-names.Tests.ps1 checks the switch with the name set and not set, that
the endpoint is put back after the step, when it fails and when it was not
set before, that the Bespoke key is left as it is, and that no other CI
script reads CLOUD_STAGING_ENDPOINT and none reads
RESOURCE_KEY_BESPOKE_STAGING. AGENTS.md and pipeline/ci/README.md say the
same.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant